-- 路径处理，按linux 规则
--公共函数，出来路径啥的
string.split = function(s, p)
    local rt= {}
    string.gsub(s, '[^'..p..']+', function(w) table.insert(rt, w) end )
    return rt
end

local M={}
function M.GetPath(path,cmd)
  local subPath= string.split(path, '\\')
  local subCmd= string.split(cmd, '/')
  local e = #subPath
  local s = 1
  for _,v in pairs(subCmd) do
    if v==".." then
      e=e-1
      s=s+1
    end
  end
  local  newPath = ""
  for i=1,e,1 do
    newPath=newPath..subPath[i].."\\"
  end
  for j=s,#subCmd,1 do
    newPath=newPath..subCmd[j].."\\"
  end
  return  newPath
end

return M